from pyecharts.charts import Line
from pyecharts.options import TitleOpts, LegendOpts, ToolboxOpts, VisualMapOpts

line1 = Line()
line1.add_xaxis(["china","china1","china2","china3","china4"])
line1.add_yaxis("国家",[1,2,3,4,5])

# 设置全局配置
line1.set_global_opts(
    # 底部居中显示
    title_opts=TitleOpts(title="国家",pos_left="center",pos_bottom="1%"),
    # 图例
    legend_opts=LegendOpts(is_show=True),
    # 工具箱
    toolbox_opts=ToolboxOpts(),
    # 视觉展示
    visualmap_opts=VisualMapOpts(),
)

# 生成图表
line1.render()